<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="./news/common/mytaglibs.jsp"%>
<body>
<div>
    <p id="sel" >

    </p>
</div>

<script>
    function add(p_id){
        //设置默认值
        var $select = $("<select>请选择</select>");
        //获取json对象
        $.post("${ctx}/querySelTopic",{
            username:"zhangsan"
            },
            function(data){
            debugger
              $.each(data,function (i,object){
                  var $option = $("<option>"+object+"</option>");
                  $select.append($option);
              });
              $("#"+p_id).append($select);
            },
            "json"
            );

    }

    $(function (){
        add("sel");
    })

</script>


</body>
</html>
